marine generator working principle